/* -*-c++-*- */
/* osgGIS - GIS Library for OpenSceneGraph
 * Copyright 2007-2008 Glenn Waldron and Pelican Ventures, Inc.
 * http://osggis.org
 *
 * osgGIS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */

#ifndef _OSGGISPROJECTS_PROJECT_H_
#define _OSGGISPROJECTS_PROJECT_H_ 1

#include <osgGISProjects/Common>
#include <osgGISProjects/Source>
#include <osgGISProjects/BuildLayer>
#include <osgGISProjects/BuildTarget>
#include <osgGISProjects/Terrain>
#include <osgGISProjects/RuntimeMap>
#include <osgGIS/FilterGraph>
#include <osgGIS/Script>
#include <osgGIS/ResourceLibrary>

using namespace osgGIS;

namespace osgGISProjects
{
    class OSGGISPROJECTS_EXPORT Project : public osg::Referenced
    {
    public:
        Project();
        virtual ~Project();
        
        void setSourceURI( const std::string& uri );
        
        const std::string& getSourceURI() const;
        
        std::string getBaseURI() const;

        const std::string& getName() const;

        void setName( const std::string& name );

        const std::string getWorkingDirectory() const;

        const std::string getAbsoluteWorkingDirectory() const;

        void setWorkingDirectory( const std::string& );
        
        void merge( class Project* from );

        

        const FilterGraphList& getFilterGraphs() const;

        FilterGraphList& getFilterGraphs();

        FilterGraph* getFilterGraph( const std::string& name );


        const SourceList& getSources() const;

        SourceList& getSources();

        Source* getSource( const std::string& name );
        
        bool testSources() const;


        const TerrainList& getTerrains() const;

        TerrainList& getTerrains();

        Terrain* getTerrain( const std::string& name );


        const BuildLayerList& getLayers() const;

        BuildLayerList& getLayers();

        BuildLayer* getLayer( const std::string& name );


        const BuildTargetList& getTargets() const;

        BuildTargetList& getTargets();

        BuildTarget* getTarget( const std::string& name );


        const RuntimeMapList& getMaps() const;

        RuntimeMapList& getMaps();

        RuntimeMap* getMap( const std::string& name );
        

        const ResourceList& getResources() const;

        ResourceList& getResources();


        const ScriptList& getScripts() const;

        ScriptList& getScripts();
        
        
    protected:
        std::string     source_uri;
        std::string     name;
        std::string     work_dir;
        FilterGraphList graphs;
        SourceList      sources;
        TerrainList     terrains;
        BuildLayerList  layers;
        BuildTargetList targets;
        RuntimeMapList  maps;
        ScriptList      scripts;
        ResourceList    resources;
        
    };
}

#endif // _OSGGISPROJECTS_PROJECT_H_

